<?php
namespace Home\Controller;
use Think\Controller;
class CompanyController extends Controller{
    public function about(){
        $this->display();
    }
    public function contact() {
        $this->display();
    }
     public function captcha() {
        require_once LIB_PATH. 'custom/securimage/securimage.php';
        $img = new \Securimage();
        if (!empty($_GET['namespace'])) $img->setNamespace($_GET['namespace']);
        $img->show();             
    }
    public function doContact() {
        $data['name']=I('post.name');
        $data['email']=I('post.email');
        $data['qq']=I('post.qq');
        $data['phone']=I('post.phone');
        $data['body']=I('post.body');
        require_once LIB_PATH. 'custom/securimage/securimage.php';
        $securimage = new\ Securimage();
        $captcha=I('post.captcha');
       if ($securimage->check($captcha) == false){
        $this->error('验证码错误');}else{
            $Newsmodel=M(contact);
            $Newsmodel->data($data)->add();
            $this->success('提交成功','contact');
        }    
    }   
    public function pub() {
        $this->display();
    }
}